//
//  EmojiCell.m
//  YunShouHu
//
//  Created by WangQiang on 16/6/22.
//  Copyright © 2016年 WangQiang. All rights reserved.
//

#import "EmojiCell.h"
@interface EmojiCell()
//@property (weak ,nonatomic) UILabel *emojiLabel;
@property (weak ,nonatomic) UIImageView *iconView;
@end

@implementation EmojiCell

-(void)commonInit{
    UIImageView *iconView = [[UIImageView alloc] init];
//    iconView.contentMode = UIViewContentModeCenter;
    self.iconView = iconView;
    [self.contentView addSubview:iconView];
    self.backgroundColor = [UIColor clearColor];
}
-(instancetype)initWithFrame:(CGRect)frame{
    if(self = [super initWithFrame:frame]){
        [self commonInit];
    }
    return self;
}
-(void)layoutSubviews{
    [super layoutSubviews];
    self.iconView.frame = self.bounds;
}
-(void)setSelected:(BOOL)selected{
    if(self.emoji){
      [super setSelected:selected];
    }
    
}
-(void)setEmoji:(EmojiEmotion *)emoji{
    _emoji = emoji;
    if(_emoji){
        self.iconView.image = [UIImage imageNamed:_emoji.pngName];
    }else{
        self.iconView.image = nil;
    }
  
}

@end
